module HomeHelper

  def carousel_for(count)

    cls = index_for(count)
    content_tag(:li, "", "data-target" => "#carousel-banner-generic", "data-slide-to" =>  count, class: cls)

  end

  def carousel_item_for(index, &block)

    cls = index_for(index)
    content_tag(:div, class: "item #{cls}") do
        block.call
    end

  end


  private

  def index_for(index)
    index == 0 ? "active" : ""
  end
end
